import request from '@/utils/request'

// 校验表单
export function checkForm(data) {
  return request({
    baseURL: process.env.NODE_ENV == 'development' ? '/form_api' : '/api',
    url: '/form/api/paper/checkForm',
    method: 'post',
    data
  })
}

// 获取表单数据
export function getFormData(params) {
  return request({
    baseURL: process.env.NODE_ENV == 'development' ? '/form_api' : '/api',
    url: '/form/api/paper/getCurFormInfo',
    method: 'get',
    params
  })
}

// 提交表单
export function insertPaperResult(data) {
  return request({
    baseURL: process.env.NODE_ENV == 'development' ? '/form_api' : '/api',
    url: '/form/api/paperResult/insert',
    method: 'post',
    data
  })
}

// 获取填写详情
export function selectPaperResult(params) {
  return request({
    baseURL: process.env.NODE_ENV == 'development' ? '/form_api' : '/api',
    url: '/form/api/paperResult/select',
    method: 'get',
    params
  })
}
// 所有填写记录(自己的)
export function selectPaperResultList(params) {
  return request({
    baseURL: process.env.NODE_ENV == 'development' ? '/form_api' : '/api',
    url: '/form/api/paperResult/selectList',
    method: 'get',
    params
  })
}

// 分页填写记录(自己的)
export function selectPaperResultPage(params) {
  return request({
    baseURL: process.env.NODE_ENV == 'development' ? '/form_api' : '/api',
    url: '/form/api/paperResult/selectPage',
    method: 'get',
    params
  })
}
